import { Component } from '@angular/core'
import { Router } from '@angular/router'

@Component({
  selector: 'cp-tabbar',
  templateUrl: './tabbar.component.html',
  styleUrls: ['./tabbar.component.scss']
})
export class TabbarComponent {
  tabbar = [
    { link: '/workspace/home/index', title: '首页', icon: 'icon_tab_home' },
    { link: '/workspace/discover/index', title: '发现', icon: 'icon_tab_discover' },
    { link: '/workspace/follow/index', title: '关注', icon: 'icon_tab_follow' },
    { link: '/workspace/mine/index', title: '我的', icon: 'icon_tab_mine' }
  ]

  constructor(private router: Router) {}

  tabChange(tab) {
    this.router.navigate([tab.link])
  }
}
